
Glosspaste 1.1
Samuel Murray, October 2009

This is a script for inserting glossary items with a keyboard shortcut.

It requires two things:
* you don't move your OmegaT window around from place to place
* you gotta have use "Tab" to advance enabled

When you use the script, and you want to insert glossary items, press Ctrl+Shift+Enter.  The script will then read the glossary pane and show a tooltip with numbered options.  The script will also activate Glosspaste mode, which means that if you type a number, the corresponding term will be inserted.  Whenever you've inserted a term, the script deactivates Glosspaste mode.  If you want to insert another term (or if you decide not to insert a term), press Ctrl+Enter to toggle Glosspaste mode.  You can dismiss the tooltip with Ctrl+Shift+Spacebar.

If you press Ctrl+N, Ctrl+P, Ctrl+U or TAB, the tooltip will remain where it is, and its terms will remain active too.  If you want to be able to move to the next or previous segment and have the tooltip dismissed automatically when you do so, Use Ctrl+< instead of Ctrl+P and use Ctrl+> instead of Ctrl+U.

The script needs to be told where on your screen is the Glossary pane and where on your screen is the Editing pane's pane bar, and you also need to tell the script where you want the tooltip with the terms to appear on your screen.  The script asks for the coordinates of these three things at the beginning.

To exit the script, right-click the icon in the systray.  Don't run the script twice without first exiting the first instance, or strange things may happen.

So, to recap:

1. Don't move your OmegaT window or your glossary pane around.
2. In OmegaT, enable Options > Use TAB to advance
3. Use Ctrl+Shift+ENTER to read glossary terms.
4. Use Ctrl+ENTER to toggle Glosspaste mode
5. In Glosspaste mode, type a number to insert that term number.
6. Use Ctrl+Shift+Spacebar to dismiss the tooltip

Issues:

1. If you move OmegaT to another place on the screen, kill the script and rerun it, so that the new coordinates can be captured.
2. You can't call back the tooltip once you've dismissed it, but you can still use the shortcuts :-)
3. Selecting a term that isn't there will cause a space to be typed.
4. You can use a traytip too, if you prefer -- just edit the script (comment out the one thing, comment in the other).
5. As with all my scripts, if you're using Unicode, you may find yourself sunk.
6. If you have an equal sign in a glossary item, the script may crash.
7. The script doesn't detect whether you've pressed a shortcut while or whilen't OmegaT is open, so if you want to do something else for a while that may use one of the script's shortcuts, pause or exit the script to be sure.

The script is written in AutoIt script language.  If you don't have AutoIt installed, just use the EXE file (and if your anti-virus program complains, it's a false positive, so create an exception).  If you do edit the script and you want to run it, run the AU3 file, not the EXE file.

